/* -----------------------------------------------------------------------
 * Name:   Krishan Kodali
 * Course: CS 362
 * Date:   01/26/14
 * unittest3.c is to test numHandCards funtion in dominion.c
 * -----------------------------------------------------------------------
 */

#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>


int main() {
    int i;
    int r; 
    int check_count; 
    int seed = 1000;
    int numPlayer = 2;
    int k[10] = {adventurer, council_room, feast, gardens, mine,
                remodel, smithy, village, baron, great_hall};
    struct gameState G;
        printf("TESTING numHandCards\n");
        printf("====================\n");
    for (i = 1; i <= numPlayer; i++){

        memset(&G, 23, sizeof(struct gameState));   // clear the game state
        r = initializeGame(numPlayer, k, seed, &G); // initialize a new game

        G.whoseTurn = i;
        G.handCount[1] = 5;
        G.handCount[2] = 10;

        printf("Testing numHandCards() for player %d:\n", i);

        check_count = numHandCards(&G);
        printf("numHandCards returned %d,  ", check_count);
        if(check_count == 5){
        printf("expected : 5\n");
        printf("TEST PASSED for player %d:\n", i);
        }
        if(check_count == 10){
        printf("expected : 10\n");
        printf("TEST PASSED for player %d:\n\n", i);
        }
   }

    return 0;
}
